﻿bob.ns.setNs('bob.unitTest', {

    runTestObject: function (objTest) {

        if (!bob.utils.isObject(objTest)) {
            throw new Error('Wrong argument: objTest.');
        }

        var testResult = true;
        for (var member in objTest) {
            var memberValue = objTest[member];
            if (bob.utils.isFunction(memberValue)) {
                try {
                    memberValue();
                    console.log(bob.string.formatString('SUCCESS in Test Function "{0}".', member));
                }
                catch (error) {
                    testResult = false;
                    console.log(bob.string.formatString('FAILURE in Test Function "{0}": {1}.', member, error.message));
                }
            }
        }
        return testResult;
    }

});
